#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<assert.h>
void my_memmove(void* dest, const void* src, int num)
{
	assert(dest && src);
	void* ret = dest;
	if (dest < src)
	{
		while (num--)
		{
			*(char*)dest = *(char*)src;
			dest=(char*)dest+1;
			src=(char*)src+1;
		}
	}
	else
	{
		while (num--)
		{
			*((char*)dest + num) = *((char*)src + num);
		}
	}
	return ret;
}
void test()
{
	int arr1[] = { 1,2,3,4,5,6,7,8,9,10};
	int arr2[20] = { 0 };
	my_memmove(arr1+2, arr1, 20);
	int i = 0;
	for(i=0;i<10;i++)
	{
		printf("%d ", arr1[i]);
	}
}
int main()
{
	test();
	return 0;
}
void reverse(int arr[])
{
    assert(arr);
    int c = 0;
    while (*arr != 0)
    {
        c++;
    }
    int* left = arr;
    int* right = arr + c - 1;
    while (left < right)
    {
        int tmp = *left;
        *left = *right;
        *right = tmp;
        left++;
        right--;
    }
}

